<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //继承:是原型的继承，而不是改变构造函数的原型
let a={name:"a"};
let b={name:"b"};
        //设置父级
        //1
        a.__proto__=Object.create(b);//创建空父级就为null
        console.log(a);

        //2
        // Object.setPrototypeOf(a,b);
        // console.log(a);
         
    </script>
</body>
</html>